<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="/js/layui/css/layui.css" media="all">
    <script src="/js/layui/layui.all.js"></script>
    <script src="/admin/js/token.js"></script>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <table id="shenhe" class="layui-hide" lay-filter="t"></table>
        </div>

    </div>
</div>
</body>
<script type="text/html" id="tb">
    <div class="layui-container">
        <span class="">主题列表</span>
    </div>
</script>
<script type="text/html" id="sh">
    <input type="button" id="dsh" value="去审核" class="layui-btn layui-btn-sm" lay-event="shenhe"/>
</script>
</body>
<script>
    var $ = layui.$;
    var form = layui.form;
    var table = layui.table;
    table.render({
        elem: "#shenhe",
        url: "/admin/theme/welcomepageshenhe",
        id: "t",
        toolbar: '#tb',
        cols: [
            [{
                title: "站点名称",
                field: "station_name",
                width: "25%",
                fixed: "left",
                align: "center"
            }, {
                title: "主题名称",
                field: "theme_name",
                width: "25%",
                align: "center"
            }, {
                title: "主题图片",
                field: "theme_image",
                templet: function(d) {
                    return "<img width='50px' height='50px' src='"+"/images/" + d.theme_image + "'></img>";
                },
                width: "25%",
                align: "center"
            }, {
                title: "操作",
                width: "25%",
                align: "center",
                toolbar: "#sh",
                fixed: "right"
            }, {
                title: "id",
                field: "theme_id",
                hide: true
            }

            ]
        ],
        page: true,
        limit:40
    });
    //    右侧按钮的的监听事件
    table.on("tool(t)", function (obj) {
        var getdata = obj.data; //获得当前行数据
        var layEvent = obj.event;
        var tr=obj.tr;
        switch (layEvent) {
            case"shenhe":
                 var id = getdata.theme_id;
                 location = "/welcomeAudit?id="+id;
                break;
        }
    });

</script>
</html>